/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.source.entity.image;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.thinkgem.jeesite.common.persistence.DataEntity;
import com.thinkgem.jeesite.modules.source.entity.video.EleSourceVideoGroup;
import org.hibernate.validator.constraints.Length;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

/**
 * 图片资源管理Entity
 * @author ZC
 * @version 2017-04-20
 */
@XmlType(name="image") 
public class EleSourceImage extends DataEntity<EleSourceImage> {
	
	private static final long serialVersionUID = 1L;
	private EleSourceImageGroup group;		// group_id 父类
	private String name;		// 视频名称
	private String index;		// 播放序列序号
	private String path;		// 图片路径
	private String correspondingFloor;		// 对应的楼层
	private String groupId;

	public EleSourceImage() {
		super();
	}

	public EleSourceImage(String id){
		super(id);
	}

	public void setGroupId(String groupId){
		this.group = new EleSourceImageGroup(groupId);
	}

	public EleSourceImage(EleSourceImageGroup group){
		this.group = group;
	}
	@JsonIgnore
	@XmlTransient
	@Length(min=0, max=100, message="group_id长度必须介于 0 和 100 之间")
	public EleSourceImageGroup getGroup() {
		return group;
	}

	public void setGroup(EleSourceImageGroup group) {
		this.group = group;
	}
	
	@XmlElement(name = "name")  
	@Length(min=0, max=255, message="视频名称长度必须介于 0 和 255 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@XmlElement(name = "index")
	public String getIndex() {
	    if(null == index){
            index ="";
        }
		return index;
	}

	public void setIndex(String index) {
		this.index = index;
	}
	@XmlElement(name = "path")	
	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}
	
	@XmlElement(name = "corresponding_floor")
	@Length(min=0, max=255, message="对应的楼层长度必须介于 0 和 255 之间")
	public String getCorrespondingFloor() {
		return correspondingFloor;
	}

	public void setCorrespondingFloor(String correspondingFloor) {
		this.correspondingFloor = correspondingFloor;
	}

}